<template>
  <transition name="el-zoom-in-center">
    <div class="cu-preview-main records">
      <div class="cu-common-page-header">
        <el-page-header @back="goBack" :content="'参保记录'" />
        <el-button type="primary" style='margin-left: 30px' v-if='type === "campus"' icon="el-icon-plus" size='small' @click="addOrUpdateHandle()"  >新增</el-button>
      </div>
      <el-col :span="24">
        <custom-table v-loading="loading" :data="list" :hasNO="false">
          <el-table-column prop="policyName" label="保险名称" align="left">
            <template slot-scope="scope">
              {{ scope.row.policyName | dynamicCodeText(policyNameOptions) }}
            </template>
          </el-table-column>
          <el-table-column prop="policyNumber" label="投保单号" align="center" />
          <el-table-column prop="insuranceCompany" label="投保公司" align="left">
            <template slot-scope="scope">
              {{ scope.row.insuranceCompany | dynamicCodeText(insuranceCompanyOptions) }}
            </template>
          </el-table-column>
          <el-table-column prop="effectiveDate" label="投保日期" align="center" :formatter="custom.tableDateFormat" />
          <el-table-column prop="expirationDate" label="到期日期" align="center" :formatter="custom.tableDateFormat" />
          <el-table-column prop="createUserName" label="记录人" align="left" />
          <el-table-column prop="description" label="备注" width="200" show-overflow-tooltip />
          <el-table-column prop="appendix" label="操作" align="center" width="130">
            <template slot-scope="scope">
              <el-button type="text" @click="addOrUpdateHandle(scope.row.id, true)">编辑</el-button>
              <el-button type="text" @click="handleDel(scope.row.id)">删除</el-button>
            </template>
          </el-table-column>
        </custom-table>
      </el-col>
      <custom-form v-if="formVisible" ref="CustomForm" @refresh="refresh" :type='type'/>
    </div>
  </transition>
</template>
<script>
export { default } from './index.js'
</script>
<style scoped>
.el-time-spinner__wrapper {
  width: 100% !important;
}
/* @import url(index.scss); */
</style>
